<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组去重算法</title>
	</head>
	<body>
		<script>
		function unite(arr1, arr2, arr3) {
			for(var a=1;a<arguments.length;a++){
				for(var i=0;i<arguments[a].length;i++){
					for(var j=0;j<arr1.length;j++){
						if(arguments[a][i]==arr1[j]){
							break;
						}else if(arr1.length==j+1){
							arr1.push(arguments[a][i]);
							break;
						}
					}
				}
			}
		    return arr1;
		}
		
		document.write(unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]));
		</script>
	</body>
</html>
